
#ifndef _STREAM_SESSION_WIDGET_H_
#define _STREAM_SESSION_WIDGET_H_

#include <QtGui>
#include "def.h"

class StreamSessionWidget : public QGroupBox
{
	Q_OBJECT

public:
	StreamSessionWidget(void);
	~StreamSessionWidget(void);

	void update(const IceCastSlot *slotAvail, const IceCastSlot *slotNext);
	void enableSelecting(bool bEnabled) { m_cmbCurrentSessionContent->setEnabled(bEnabled); }
	IceCastSlot * currentSlot();

signals:
	void onCurrentSlotChanged(const IceCastSlot*);
#if DEBUG
	void logged(const char*);
#endif

private:
	void createInterface();

	IceCastSlot * m_availSlot;
	IceCastSlot * m_nextSlot;
	QTimer * m_timer;

	QLabel * m_lblCurrentSession;
	QComboBox * m_cmbCurrentSessionContent;
	QLabel * m_lblNextSession;
	QComboBox * m_cmbNextSessionContent;
	QLabel * m_lblBeforeSessionStart;
	QLabel * m_lblBeforeSessionStartContent;
	QLabel * m_lblBeforeSessionEnd;
	QLabel * m_lblBeforeSessionEndContent;

private slots:
	void onTimer();
	void onSelectedIndexChanged(int index);

signals:
	void timerout();

};

#endif // _STREAM_SESSION_WIDGET_H_
